/*
 * Criado em Mar 21, 2005
 *
 *
 */
package vendas.dto;

import gminet.infra.dao.SimpleTransferObject;

import java.util.List;

/**
 * @author Gabriel Flores Mendes
 * 
 * 
 */
public class ActiveStatus extends SimpleTransferObject {

    private static final long serialVersionUID = -4602011085338903093L;

    private static final byte ACTIVE_ID = 1;
    private static final byte INACTIVE_ID = 0;

    public static final ActiveStatus ACTIVE = new ActiveStatus(ACTIVE_ID, "Ativo");
    public static final ActiveStatus INACTIVE = new ActiveStatus(INACTIVE_ID, "Excluido");

    static {
        Class<ActiveStatus> clazz = ActiveStatus.class;
        addObject(clazz, ACTIVE);
        addObject(clazz, INACTIVE);
    }

    private ActiveStatus(int i, String str) {

        super(i, str);
    }

    public boolean isActive() {

        return getId() == ACTIVE_ID;
    }

    @SuppressWarnings("unchecked")
    public static List<ActiveStatus> getList() {

        return (List<ActiveStatus>) getList(ActiveStatus.class);
    }

    public static ActiveStatus getActiveStatusById(int statusId) {

        return (ActiveStatus) getObject(ActiveStatus.class, statusId);
    }

}
